package mo.leetcode_hot;

public class L461 {

    public int hammingDistance(int x, int y) {
        int z = x ^ y;
        int res = 0;
        for (int i = 0; i < 32; i++) {
            res += (z & 1);
            z = z >> 1;
        }
        return res;
    }

    public static void main(String[] args) {
        L461 test = new L461();
        System.out.println(test.hammingDistance(1, 4));
    }
}
